<!DOCTYPE html>
<html>
<head>
<script src="../resources/event-sender-util.js"></script>
<script src="../../../resources/js-test.js"></script>
</head>
<body>

<div id="host"></div>
<pre id="console"></pre>

<script>
function createBox(name) {
    var div = document.createElement('div');
    div.style.width = '100px';
    div.style.height = '100px';

    div.addEventListener('drop', function(e) {
        debug('PASS: drop event is fired.');
    });

    return div;
}

var shadowRoot = host.attachShadow({mode: 'open'});
var div = document.createElement('div');
shadowRoot.appendChild(div);

var darkRoot = div.attachShadow({mode: 'open'});
var box = createBox('dark');
darkRoot.appendChild(box);

var x = box.offsetLeft + box.offsetWidth / 2;
var y = box.offsetTop + box.offsetHeight / 2;

var element = document.elementFromPoint(x, y);

shouldBe("internals.treeScopeRootNode(element)", "document");

var successfullyParsed = true;
</script>

</body>
</html>
